Linux file system commands
Basic Navigation Commands
-
pwd— Print working directory (shows the current directory path) -
ls— List files and directories in the current directory -
cd— Change directory -
cd ~— Go to the home directory -
cd ..— Move one directory up -
ls -l— List files with detailed information (permissions, owner, size)
File and Directory Management:
-
mkdir— Create a new directory -
rmdir— Remove an empty directory -
rm— Remove files or directories -
cp— Copy files or directories -
mv— Move or rename files or directories -
touch— Create an empty file or update file timestamp -
find— Search for files and directories
File Viewing and Editing:
-
cat— Display file contents -
more— View file contents page by page -
less— View file contents with backward navigation -
nano— Simple text editor for editing files -
vim— Advanced text editor for editing files
File Permissions:
-
chmod— Change file permissions -
chown— Change file owner and group -
chgrp— Change the group ownership of a file
Disk Usage and Information:
-
df— Show disk space usage of file systems -
du— Display file and directory space usage -
lsblk— List information about block devices -
fdisk— Partition a disk
File System Mounting and Management:
-
mount— Mount a file system -
umount— Unmount a file system -
blkid— Display information about available block devices
Other Useful Commands:
-
stat— Display file or file system status -
ln— Create symbolic or hard links -
tar— Create or extract compressed archive files